<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="modal fade" tabindex="-1" role="dialog"
  aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{ backdrop: 'static', keyboard: !saving }">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <form *ngIf="active" #userForm="ngForm" novalidate autocomplete="off">
        <div class="modal-header">
          <h4 class="modal-title">
            <span>外包加工单</span>
          </h4>
          <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')" [disabled]="saving">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body" style="height: 500px;overflow: auto;">

          <!-- <div class="col-xl-12">
            <div class="form-group m-form__group">
              <div class="input-group">
                <input [(ngModel)]="filterText" name="filterText" autoFocus class="form-control m-input"
                  [placeholder]="l('SearchWithThreeDot')" type="text">
                <span class="input-group-btn">
                  <button (click)="getTasks()" class="btn btn-primary"><i class="flaticon-search-1"
                      [attr.aria-label]="l('Search')"></i></button>
                </span>
              </div>
            </div>
          </div> -->
          <div class="row">
            <div class="align-items-center">
              <!--<Primeng-TurboTable-Start>-->
                  <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
                      <p-table #dataTable (onLazyLoad)="getTasks($event)"
                        [value]="primengTableHelper.records" rows="{{primengTableHelper.defaultRecordsCountPerPage}}"
                        [paginator]="false" [lazy]="true" [scrollable]="true" ScrollWidth="100%"
                        [responsive]="primengTableHelper.isResponsive" [resizableColumns]="true">
                  <ng-template pTemplate="header">
                    <tr>
                      <th style="width: 130px">
                        操作</th>
                      <th style="width: 150px">
                        任务号
                      </th>
                      <th style="width: 150px">
                        名称
                      </th>
                      <th style="width: 150px">
                        图号
                      </th>
                      <th style="width: 150px">
                        加工单编号
                      </th>
                      <th style="width: 150px">
                        申请单号
                      </th>
                      <th style="width: 200px">
                        申请类型
                      </th>
                      <th style="width: 100px">
                        申请进度
                      </th>
                      <th style="width: 100px">
                        加工数量
                      </th>
                      <th style="width: 100px">
                        单价
                      </th>
                      <th style="width: 100px">
                        金额
                      </th>
                      <th style="width: 150px">
                        申请单位
                      </th>
                      <th style="width: 150px">
                        合格供方单位
                      </th>
                      <th style="width: 130px">
                        申请时间
                      </th>
                      <th style="width: 100px">
                        申请人
                      </th> 
                      <th style="width: 200px">
                        备注
                      </th>
                    </tr>
                  </ng-template>
                  <ng-template pTemplate="body" let-record="$implicit">
                    <tr>
                      <td style="width: 130px">
                        <div class="btn-group dropdown" dropdown container="body">
                          <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                            <i class="fa fa-cog"></i><span class="caret"></span>
                            操作
                          </button>
                          <ul class="dropdown-menu" *dropdownMenu>
                            <!-- <li>
                                  <a href="javascript:;" (click)="Detail(record)">详情</a>
                                </li> -->
                            <li>
                              <a href="javascript:;">交货确认单</a>
                            </li>

                          </ul>
                        </div>
                      </td>
                      <td style="width: 150px">
                          <div [ngSwitch]="record.taskCode">
                              <div *ngSwitchCase="">
                                  <div class="m-loader m-loader--warning" style="width: 30px; display: inline-block;"></div>
                              </div>
                              <div *ngSwitchDefault>
                                  <!-- <span class="m-badge m-badge--info m-badge--dot"></span>&nbsp; -->
                                  <span class="m--font-bold"> {{record.taskCode}}</span>
                              </div>
                          </div>
                      </td>
                      <td style="width: 150px">
                          <div [ngSwitch]="record.taskName">
                              <div *ngSwitchCase="">
                                  <div class="m-loader m-loader--warning" style="width: 30px; display: inline-block;"></div>
                              </div>
                              <div *ngSwitchDefault>
                                  <!-- <span class="m-badge m-badge--info m-badge--dot"></span>&nbsp; -->
                                  <span class="m--font-bold"> {{record.taskName}}</span>
                              </div>
                          </div>
                      </td>
                      <td style="width: 150px">
                          <div [ngSwitch]="record.picNo">
                              <div *ngSwitchCase="">
                                  <div class="m-loader m-loader--warning" style="width: 30px; display: inline-block;"></div>
                              </div>
                              <div *ngSwitchDefault>
                                  <!-- <span class="m-badge m-badge--info m-badge--dot"></span>&nbsp; -->
                                  <span class="m--font-bold"> {{record.picNo}}</span>
                              </div>
                          </div>
                      </td>
                      <td style="width: 150px">
                        {{record.orderCode}}
                      </td>
                      <td style="width: 150px">
                        {{record.requisitionCode}}
                      </td>
                      <td style="width: 200px">
                        {{record.applyType}}
                      </td>
                      <td style="width: 100px"> 
                         <div *ngIf="record.applyStatus == 1">完成</div>
                         <div *ngIf="record.applyStatus == 0">运行</div>
                      </td>
                      <td style="width: 100px">
                        {{record.processingAmount}}
                      </td>
                      <td style="width: 100px">
                        {{record.unitprice}}
                      </td>
                      <td style="width: 100px">
                        {{record.processingAmount * record.unitprice}}
                      </td>
                      <td style="width: 150px">
                          {{record.applyUnit}}
                      </td>
                      <td style="width: 150px">
                          {{record.supplierUnit}}
                      </td>
                      <td style="width: 130px">
                          {{record.creationTime | momentFormat:'L'}}
                      </td>
                      <td style="width: 100px">
                        {{record.createdUser}}
                      </td> 
                      <td style="width: 200px">
                        {{record.explain}}
                      </td>
                    </tr>
                  </ng-template>
                </p-table>
                <div class="primeng-no-data" *ngIf="primengTableHelper.totalRecordsCount == 0">
                    {{'NoData' | localize}}
                  </div>
                  <div class="primeng-paging-container">
                    <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                      (onPageChange)="getTasks($event)"
                      [totalRecords]="primengTableHelper.totalRecordsCount"
                      [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
      
                    </p-paginator>
                    <span class="total-records-count">
                      {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                    </span>
                  </div>
                </div>
              <!--<Primeng-TurboTable-End>-->
            </div>
          </div>


        </div>
      </form>
    </div>
  </div>

</div>